package com.vunguyen.model;
// Generated Nov 29, 2014 7:36:58 AM by Hibernate Tools 3.6.0


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * Congvanden generated by hbm2java
 */
@Entity
@Table(name="congvanden"
    ,catalog="qlkhoacntt"
)
public class Congvanden  implements java.io.Serializable {


     private String idCongVanDen;
     private Congvan congvan;
     private Date ngayNhan;
     private String noiGui;
     private Set<Phancongcongvanden> phancongcongvandens = new HashSet<Phancongcongvanden>(0);

    public Congvanden() {
    }

	
    public Congvanden(Congvan congvan, Date ngayNhan, String noiGui) {
        this.congvan = congvan;
        this.ngayNhan = ngayNhan;
        this.noiGui = noiGui;
    }
    public Congvanden(Congvan congvan, Date ngayNhan, String noiGui, Set<Phancongcongvanden> phancongcongvandens) {
       this.congvan = congvan;
       this.ngayNhan = ngayNhan;
       this.noiGui = noiGui;
       this.phancongcongvandens = phancongcongvandens;
    }
   
     @GenericGenerator(name="generator", strategy="foreign", parameters=@Parameter(name="property", value="congvan"))@Id @GeneratedValue(generator="generator")

    
    @Column(name="idCongVanDen", unique=true, nullable=false, length=20)
    public String getIdCongVanDen() {
        return this.idCongVanDen;
    }
    
    public void setIdCongVanDen(String idCongVanDen) {
        this.idCongVanDen = idCongVanDen;
    }

@OneToOne(fetch=FetchType.EAGER)@PrimaryKeyJoinColumn
    public Congvan getCongvan() {
        return this.congvan;
    }
    
    public void setCongvan(Congvan congvan) {
        this.congvan = congvan;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="NgayNhan", nullable=false, length=10)
    public Date getNgayNhan() {
        return this.ngayNhan;
    }
    
    public void setNgayNhan(Date ngayNhan) {
        this.ngayNhan = ngayNhan;
    }

    
    @Column(name="NoiGui", nullable=false, length=50)
    public String getNoiGui() {
        return this.noiGui;
    }
    
    public void setNoiGui(String noiGui) {
        this.noiGui = noiGui;
    }

@OneToMany(fetch=FetchType.EAGER, mappedBy="congvanden")
    public Set<Phancongcongvanden> getPhancongcongvandens() {
        return this.phancongcongvandens;
    }
    
    public void setPhancongcongvandens(Set<Phancongcongvanden> phancongcongvandens) {
        this.phancongcongvandens = phancongcongvandens;
    }




}


